Integrand size = 19, antiderivative size = 82 \[ \int \frac {\sec (c+d x)}{(a+b \tan (c+d x))^2} \, dx=-\frac {a \text {arctanh}\left (\frac {b \cos (c+d x)-a \sin (c+d x)}{\sqrt {a^2+b^2}}\right )}{\left (a^2+b^2\right )^{3/2} d}-\frac {b \sec (c+d x)}{\left (a^2+b^2\right ) d (a+b \tan (c+d x))} \]
-a*arctanh((b*cos(d*x+c)-a*sin(d*x+c))/(a^2+b^2)^(1/2))/(a^2+b^2)^(3/2)/d- b*sec(d*x+c)/(a^2+b^2)/d/(a+b*tan(d*x+c))
Time = 0.63 (sec) , antiderivative size = 78, normalized size of antiderivative = 0.95 \[ \int \frac {\sec (c+d x)}{(a+b \tan (c+d x))^2} \, dx=\frac {\frac {2 a \text {arctanh}\left (\frac {-b+a \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a^2+b^2}}\right )}{\left (a^2+b^2\right )^{3/2}}-\frac {b \sec (c+d x)}{\left (a^2+b^2\right ) (a+b \tan (c+d x))}}{d} \]
((2*a*ArcTanh[(-b + a*Tan[(c + d*x)/2])/Sqrt[a^2 + b^2]])/(a^2 + b^2)^(3/2 ) - (b*Sec[c + d*x])/((a^2 + b^2)*(a + b*Tan[c + d*x])))/d
Time = 0.30 (sec) , antiderivative size = 103, normalized size of antiderivative = 1.26, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.263, Rules used = {3042, 3992, 491, 488, 219}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \frac {\sec (c+d x)}{(a+b \tan (c+d x))^2} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {\sec (c+d x)}{(a+b \tan (c+d x))^2}dx\) |
\(\Big \downarrow \) 3992 |
\(\displaystyle \frac {\sec (c+d x) \int \frac {1}{(a+b \tan (c+d x))^2 \sqrt {\tan ^2(c+d x)+1}}d(b \tan (c+d x))}{b d \sqrt {\sec ^2(c+d x)}}\) |
\(\Big \downarrow \) 491 |
\(\displaystyle \frac {\sec (c+d x) \left (\frac {a \int \frac {1}{(a+b \tan (c+d x)) \sqrt {\tan ^2(c+d x)+1}}d(b \tan (c+d x))}{a^2+b^2}-\frac {b^2 \sqrt {\tan ^2(c+d x)+1}}{\left (a^2+b^2\right ) (a+b \tan (c+d x))}\right )}{b d \sqrt {\sec ^2(c+d x)}}\) |
\(\Big \downarrow \) 488 |
\(\displaystyle \frac {\sec (c+d x) \left (-\frac {a \int \frac {1}{\frac {a^2}{b^2}-b^2 \tan ^2(c+d x)+1}d\frac {1-\frac {a \tan (c+d x)}{b}}{\sqrt {\tan ^2(c+d x)+1}}}{a^2+b^2}-\frac {b^2 \sqrt {\tan ^2(c+d x)+1}}{\left (a^2+b^2\right ) (a+b \tan (c+d x))}\right )}{b d \sqrt {\sec ^2(c+d x)}}\) |
\(\Big \downarrow \) 219 |
\(\displaystyle \frac {\sec (c+d x) \left (-\frac {a b \text {arctanh}\left (\frac {b^2 \tan (c+d x)}{\sqrt {a^2+b^2}}\right )}{\left (a^2+b^2\right )^{3/2}}-\frac {b^2 \sqrt {\tan ^2(c+d x)+1}}{\left (a^2+b^2\right ) (a+b \tan (c+d x))}\right )}{b d \sqrt {\sec ^2(c+d x)}}\) |
(Sec[c + d*x]*(-((a*b*ArcTanh[(b^2*Tan[c + d*x])/Sqrt[a^2 + b^2]])/(a^2 + b^2)^(3/2)) - (b^2*Sqrt[1 + Tan[c + d*x]^2])/((a^2 + b^2)*(a + b*Tan[c + d *x]))))/(b*d*Sqrt[Sec[c + d*x]^2])
3.6.63.3.1 Defintions of rubi rules used
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))* ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x] /; FreeQ[{a, b}, x] && NegQ[a/b] && (Gt Q[a, 0] || LtQ[b, 0])
Int[1/(((c_) + (d_.)*(x_))*Sqrt[(a_) + (b_.)*(x_)^2]), x_Symbol] :> -Subst[ Int[1/(b*c^2 + a*d^2 - x^2), x], x, (a*d - b*c*x)/Sqrt[a + b*x^2]] /; FreeQ [{a, b, c, d}, x]
Int[((c_) + (d_.)*(x_))^(n_)*((a_) + (b_.)*(x_)^2)^(p_), x_Symbol] :> Simp[ d*(c + d*x)^(n + 1)*((a + b*x^2)^(p + 1)/((n + 1)*(b*c^2 + a*d^2))), x] + S imp[b*(c/(b*c^2 + a*d^2)) Int[(c + d*x)^(n + 1)*(a + b*x^2)^p, x], x] /; FreeQ[{a, b, c, d, n, p}, x] && EqQ[n + 2*p + 3, 0]
Int[sec[(e_.) + (f_.)*(x_)]^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n _), x_Symbol] :> Simp[Sec[e + f*x]/(b*f*Sqrt[Sec[e + f*x]^2]) Subst[Int[( a + x)^n*(1 + x^2/b^2)^(m/2 - 1), x], x, b*Tan[e + f*x]], x] /; FreeQ[{a, b , e, f, n}, x] && NeQ[a^2 + b^2, 0] && IntegerQ[(m - 1)/2]
Time = 1.87 (sec) , antiderivative size = 118, normalized size of antiderivative = 1.44
method | result | size |
derivativedivides | \(\frac {-\frac {2 \left (-\frac {b^{2} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{a \left (a^{2}+b^{2}\right )}-\frac {b}{a^{2}+b^{2}}\right )}{\left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) a -2 b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-a}+\frac {2 a \,\operatorname {arctanh}\left (\frac {2 a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-2 b}{2 \sqrt {a^{2}+b^{2}}}\right )}{\left (a^{2}+b^{2}\right )^{\frac {3}{2}}}}{d}\) | \(118\) |
default | \(\frac {-\frac {2 \left (-\frac {b^{2} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{a \left (a^{2}+b^{2}\right )}-\frac {b}{a^{2}+b^{2}}\right )}{\left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) a -2 b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-a}+\frac {2 a \,\operatorname {arctanh}\left (\frac {2 a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-2 b}{2 \sqrt {a^{2}+b^{2}}}\right )}{\left (a^{2}+b^{2}\right )^{\frac {3}{2}}}}{d}\) | \(118\) |
risch | \(-\frac {2 i b \,{\mathrm e}^{i \left (d x +c \right )}}{\left (-i a +b \right ) d \left (i a +b \right ) \left (b \,{\mathrm e}^{2 i \left (d x +c \right )}+i a \,{\mathrm e}^{2 i \left (d x +c \right )}-b +i a \right )}+\frac {a \ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {i a^{3}+i a \,b^{2}-a^{2} b -b^{3}}{\left (a^{2}+b^{2}\right )^{\frac {3}{2}}}\right )}{\left (a^{2}+b^{2}\right )^{\frac {3}{2}} d}-\frac {a \ln \left ({\mathrm e}^{i \left (d x +c \right )}-\frac {i a^{3}+i a \,b^{2}-a^{2} b -b^{3}}{\left (a^{2}+b^{2}\right )^{\frac {3}{2}}}\right )}{\left (a^{2}+b^{2}\right )^{\frac {3}{2}} d}\) | \(190\) |
1/d*(-2*(-b^2/a/(a^2+b^2)*tan(1/2*d*x+1/2*c)-b/(a^2+b^2))/(tan(1/2*d*x+1/2 *c)^2*a-2*b*tan(1/2*d*x+1/2*c)-a)+2*a/(a^2+b^2)^(3/2)*arctanh(1/2*(2*a*tan (1/2*d*x+1/2*c)-2*b)/(a^2+b^2)^(1/2)))
Leaf count of result is larger than twice the leaf count of optimal. 215 vs. \(2 (78) = 156\).
Time = 0.27 (sec) , antiderivative size = 215, normalized size of antiderivative = 2.62 \[ \int \frac {\sec (c+d x)}{(a+b \tan (c+d x))^2} \, dx=-\frac {2 \, a^{2} b + 2 \, b^{3} - {\left (a^{2} \cos \left (d x + c\right ) + a b \sin \left (d x + c\right )\right )} \sqrt {a^{2} + b^{2}} \log \left (-\frac {2 \, a b \cos \left (d x + c\right ) \sin \left (d x + c\right ) + {\left (a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{2} - 2 \, a^{2} - b^{2} + 2 \, \sqrt {a^{2} + b^{2}} {\left (b \cos \left (d x + c\right ) - a \sin \left (d x + c\right )\right )}}{2 \, a b \cos \left (d x + c\right ) \sin \left (d x + c\right ) + {\left (a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{2} + b^{2}}\right )}{2 \, {\left ({\left (a^{5} + 2 \, a^{3} b^{2} + a b^{4}\right )} d \cos \left (d x + c\right ) + {\left (a^{4} b + 2 \, a^{2} b^{3} + b^{5}\right )} d \sin \left (d x + c\right )\right )}} \]
-1/2*(2*a^2*b + 2*b^3 - (a^2*cos(d*x + c) + a*b*sin(d*x + c))*sqrt(a^2 + b ^2)*log(-(2*a*b*cos(d*x + c)*sin(d*x + c) + (a^2 - b^2)*cos(d*x + c)^2 - 2 *a^2 - b^2 + 2*sqrt(a^2 + b^2)*(b*cos(d*x + c) - a*sin(d*x + c)))/(2*a*b*c os(d*x + c)*sin(d*x + c) + (a^2 - b^2)*cos(d*x + c)^2 + b^2)))/((a^5 + 2*a ^3*b^2 + a*b^4)*d*cos(d*x + c) + (a^4*b + 2*a^2*b^3 + b^5)*d*sin(d*x + c))
\[ \int \frac {\sec (c+d x)}{(a+b \tan (c+d x))^2} \, dx=\int \frac {\sec {\left (c + d x \right )}}{\left (a + b \tan {\left (c + d x \right )}\right )^{2}}\, dx \]
Leaf count of result is larger than twice the leaf count of optimal. 182 vs. \(2 (78) = 156\).
Time = 0.36 (sec) , antiderivative size = 182, normalized size of antiderivative = 2.22 \[ \int \frac {\sec (c+d x)}{(a+b \tan (c+d x))^2} \, dx=-\frac {\frac {a \log \left (\frac {b - \frac {a \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + \sqrt {a^{2} + b^{2}}}{b - \frac {a \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - \sqrt {a^{2} + b^{2}}}\right )}{{\left (a^{2} + b^{2}\right )}^{\frac {3}{2}}} + \frac {2 \, {\left (a b + \frac {b^{2} \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}}{a^{4} + a^{2} b^{2} + \frac {2 \, {\left (a^{3} b + a b^{3}\right )} \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - \frac {{\left (a^{4} + a^{2} b^{2}\right )} \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}}}}{d} \]
-(a*log((b - a*sin(d*x + c)/(cos(d*x + c) + 1) + sqrt(a^2 + b^2))/(b - a*s in(d*x + c)/(cos(d*x + c) + 1) - sqrt(a^2 + b^2)))/(a^2 + b^2)^(3/2) + 2*( a*b + b^2*sin(d*x + c)/(cos(d*x + c) + 1))/(a^4 + a^2*b^2 + 2*(a^3*b + a*b ^3)*sin(d*x + c)/(cos(d*x + c) + 1) - (a^4 + a^2*b^2)*sin(d*x + c)^2/(cos( d*x + c) + 1)^2))/d
Time = 0.44 (sec) , antiderivative size = 138, normalized size of antiderivative = 1.68 \[ \int \frac {\sec (c+d x)}{(a+b \tan (c+d x))^2} \, dx=-\frac {\frac {a \log \left (\frac {{\left | 2 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 2 \, b - 2 \, \sqrt {a^{2} + b^{2}} \right |}}{{\left | 2 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 2 \, b + 2 \, \sqrt {a^{2} + b^{2}} \right |}}\right )}{{\left (a^{2} + b^{2}\right )}^{\frac {3}{2}}} - \frac {2 \, {\left (b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + a b\right )}}{{\left (a^{3} + a b^{2}\right )} {\left (a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 2 \, b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - a\right )}}}{d} \]
-(a*log(abs(2*a*tan(1/2*d*x + 1/2*c) - 2*b - 2*sqrt(a^2 + b^2))/abs(2*a*ta n(1/2*d*x + 1/2*c) - 2*b + 2*sqrt(a^2 + b^2)))/(a^2 + b^2)^(3/2) - 2*(b^2* tan(1/2*d*x + 1/2*c) + a*b)/((a^3 + a*b^2)*(a*tan(1/2*d*x + 1/2*c)^2 - 2*b *tan(1/2*d*x + 1/2*c) - a)))/d
Time = 4.65 (sec) , antiderivative size = 136, normalized size of antiderivative = 1.66 \[ \int \frac {\sec (c+d x)}{(a+b \tan (c+d x))^2} \, dx=-\frac {\frac {2\,b}{a^2+b^2}+\frac {2\,b^2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{a\,\left (a^2+b^2\right )}}{d\,\left (-a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+2\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+a\right )}+\frac {a\,\mathrm {atan}\left (\frac {a^2\,b\,1{}\mathrm {i}+b^3\,1{}\mathrm {i}-a\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (a^2+b^2\right )\,1{}\mathrm {i}}{{\left (a^2+b^2\right )}^{3/2}}\right )\,2{}\mathrm {i}}{d\,{\left (a^2+b^2\right )}^{3/2}} \]